package com.amazon.controller;

import com.amazon.model.CommonResult;
import com.amazon.model.FlowModel;
import com.amazon.service.FlowingService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/amazon")
public class FlowingConroller {

    @Resource
    private FlowingService flowingService;
    @GetMapping("/flowingWater")
    public CommonResult getFlowingWater(Long startTime, Long endTime){
        FlowModel flowingWater = flowingService.getFlowingWater(startTime, endTime);
        return CommonResult.ok(flowingWater);
    }
}
